package br.ufmg.dcc.simulesspl.controller;


import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.List;

import org.junit.Test;

import br.ufmg.dcc.simulesspl.model.ProjectCard;
import br.ufmg.dcc.simulesspl.model.ProjectSelection;


public class ProjectSelectionControllerTest {

	@Test
	public void correctProjectWillBeReturned() {
		ProjectSelection psc = new ProjectSelection();
		
		List<ProjectCard> projectOptions = psc.getProjectOptions();
		assertThat(projectOptions.size(), equalTo(5));
		
		
		assertThat(psc.select(1), equalTo(projectOptions.get(0)));
		assertThat(psc.select(2), equalTo(projectOptions.get(1)));
		assertThat(psc.select(3), equalTo(projectOptions.get(2)));
	}
	
	@Test(expected=Exception.class)
	public void zeroProjectNumberWillThrowException() {
		ProjectSelection psc = new ProjectSelection();
		psc.select(0);
	}
	
	@Test(expected=Exception.class)
	public void projectNumberGreaterThan3WillThrowException() {
		ProjectSelection psc = new ProjectSelection();
		psc.select(6);
	}

}
